Skip to content

feat: choose how see-through a colour is, beside the colour - #108

Merged
xAlcahest merged 1 commit into
mainfrom
colour-alpha
Sep 6, 2026
Merged

feat: choose how see-through a colour is, beside the colour#108
xAlcahest merged 1 commit into
mainfrom
colour-alpha

Conversation

@xAlcahest

Copy link
Copy Markdown
Owner

Summary

The colour picker takes a transparency beside the colour, which is the half of the reference's colour dialog Sublore did not have. It is a number from 0 to 255, and ASS counts transparency and not opacity, so 0 is solid and 255 is invisible: the field says the word rather than leaving the direction to be guessed. An empty field writes none at all, which is this product's answer to the reference writing the alpha only when it changed.

The colour and its transparency go in as one undo step, on the planner the font picker brought in a moment ago. That planner is now the only way an override tag is written with a value the caller chose, so the single-tag path it replaced is gone rather than left standing: Edit::SetOverrideTag, plan_set_override_tag, subtitle_set_override_tag and the hook method are all removed, and the tests that covered them now send a list of one, which is what the pickers send when nothing goes beside the colour.

Changes

  • src/components/CurrentLine.tsx: the transparency field, the four \1a to \4a tags, and the pick that writes the pair as one step.
  • src/App.tsx: the singular write's prop gone, and its guard moved onto the one that remains.
  • src/hooks/useSubtitleFile.ts: setOverrideTag removed.
  • src-tauri/src/subtitle/mod.rs and lib.rs: subtitle_set_override_tag and its payload removed.
  • crates/sublore-edit/src/plan.rs: Edit::SetOverrideTag and its planner removed; the list edit is the one way in.
  • crates/sublore-edit/tests/session.rs: the three tests that used the singular now send a list of one.
  • src/i18n/en.ts: the field's word and the sentence that says which direction the number runs.
  • e2e/specs/current-line-bands.spec.js: the typed colour now carries a transparency, and one undo takes both back.
  • BACKLOG.md: N39 narrowed to the spectrum, which is all that is left of it.

How to verify it by using the app

  1. Open fixtures/subtitles/ass/clean/speakers.ass, click a row and put the caret at the start of the text box.
  2. Click the first colour button. Under the sixteen squares there is a colour field and a Clear field.
  3. Type #12AB34 into the colour and 128 into Clear, then press Enter. The line begins {\c&H34AB12&\1a&H80&}: the colour with blue first, and 128 written as hexadecimal 80.
  4. The video shows that line half see-through.
  5. Press Ctrl+Z once. The colour and the transparency go together, because choosing them is one thing you did.
  6. Type 300 into Clear and press Enter. Nothing is written and the field is marked, because a transparency runs from 0 to 255.
  7. Leave Clear empty and pick a colour from the squares. Only the colour is written, and the transparency the line already had stays as it was.

Verified on Linux: full gate green step by step, and the battery green at 35 spec files of 35 with 292 checks. One mutation, a transparency written in decimal instead of hexadecimal, reddened this check first.

@xAlcahest
xAlcahest merged commit 43916db into main Sep 6, 2026
14 checks passed
@xAlcahest
xAlcahest deleted the colour-alpha branch September 6, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant